<?php defined('SYSPATH') or die('No direct script access.') ?>

<table class="table table-condensed table-hover">
<thead>
<tr>
<th>ID</th>
<th>Роль</th>
<th>Описание</th>
</tr>
</thead>
  <tbody>
<?php
foreach($roles as &$role)
{
	?>

    <tr class="ajaxmodal" data-toggle="modal" href="<?php echo URL::site($controller.'/form'.$action) ?>/short/<?php echo $role['id'] ?>" data-target="#ajaxmodal">
        <td><?php echo $role['id'] ?></td>
        <td><?php echo $role['name'] ?></td>
        <td><?php echo $role['description'] ?></td>
    </tr>
<?php
}
?>
  </tbody>
</table>

<div id="ajaxmodal" class="modal  fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h4 class="modal-title">Добавить/изменить роль</h4>
  </div>
  <div class="modal-body"></div>
  <div class="modal-footer">
    <button type="button" data-dismiss="modal" class="btn btn-default">Закрыть</button>
    <button type="button" class="btn btn-primary" id="createrole_submit">Сохранить</button>
  </div>
</div>

<button type="button" data-toggle="modal" href="<?php echo URL::site($controller.'/form'.$action) ?>/short" data-target="#ajaxmodal" class="ajaxmodal btn btn-primary">Добавить роль</button>


<?php //echo $createrole ?>
